{template '_header'}
{php $this->followBar()}
<title>商品详情</title>
<link rel="stylesheet" href="../addons/ewei_shopv2/plugin/groups/template/mobile/default/css/style.css" />
<div class='fui-page creditshop-detail-page'>
	<div class="fui-header">
		<div class="fui-header-left">
			<a class="back" href="{php echo mobileUrl('order')}"></a>
		</div>
		<div class="title">拼团操作</div>
		<div class="fui-header-right">&nbsp;</div>
	</div>
	<div class='fui-content navbar'>
		{if !is_mobile()}<div class="pcshop-index">{/if}
		<div class="lynn_opengroups_head fui-list">
			<a href="{php echo mobileUrl('groups/goods', array('id'=>$goods['id']))}" class="lynn_index_list_a fui-list-media">
				<img src="{$goods['thumb']}" alt="{$goods['title']}" onerror="this.src='../addons/ewei_shopv2/static/images/nopic100.jpg'">
			</a>
			<div class="fui-list-inner lynn_opengroups_head_goods">
				<h2>{$goods['title']}</h2>
				<div class="lynn_opengroups_head_goods_info">
					<span class="fl">
						{$goods['groupnum']}人团：¥ <strong>{$goods['groupsprice']}/</strong>{if $goods['units']}{$goods['goodsnum']}{$goods['units']}{else}1件{/if}
					</span>
					<span class="fr">
						已有<b>{$goods['fightnum']}</b>人参团
					</span>
					<div style="clear:both;"></div>
				</div>
			</div>
		</div>
		<div class="lynn_fightgroups">
			<div class="lynn_fightgroups_head">以下小伙伴正在发起拼团，您可以直接参加</div>
			{if $teams}
			<ul class="lynn_fightgroups_list">
				{loop $teams $index $item}
				<li>
					<img src="{$item['avatar']}" alt="{$item['nickname']}" onerror="this.src='../addons/ewei_shopv2/plugin/groups/template/mobile/default/images/avatar.png'">
					<span class="lynn_fightgroups_span row">
						<strong class="fl">
							<p>{if $item['nickname']}{$item['nickname']}{else}匿名{/if}</p>
							<b>剩余：<i id="residualtime{$index}" title="{$item['residualtime']}">{$item['hour']}:{$item['minite']}:{$item['second']}</i></b>
						</strong>
						<strong class="fr">
							还差<b>{$item['num']}</b>人成团
						</strong>
					</span>
					<a href="{php echo mobileUrl('groups/orders/confirm',array('id' => $item['goodid'],'teamid' => $item['teamid'],'type'=>'groups'));}" class="fr">去参团</a>
				</li>
				{/loop}
			</ul>
			{else}
			<div class="lynn_fight_nomarl">
				暂无相关团购
			</div>
			{/if}
		</div>
		{if !is_mobile()}</div>{/if}
	</div>
	<script language='javascript'>
		require(['../addons/ewei_shopv2/plugin/groups/static/js/fightGroups.js'], function (modal) {
			modal.init();
		});
	</script>
</div>
{php $this->footerMenus()}
{template '_footer'}